﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace jnxc.Web.ecshop
{
    public partial class showcompany : System.Web.UI.Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                imgpic.Attributes.Add("onload", "AutoResizeImagea(600,600,this)");
                BLL.product mypro = new BLL.product();
                DataSet ds;// = myp.GetList(6, "province='" + pro + "'", "pbm");               
                ds = mypro.GetListV(6, "", "pdatetime desc");
                rptnew.DataSource = ds.Tables[0];
                rptnew.DataBind(); 
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    int pid = (Convert.ToInt32(strid));
                    ShowInfo(pid);
                }
            }
        }

        private void ShowInfo(int pid)
        {
            jnxc.BLL.factoryinfo bll = new jnxc.BLL.factoryinfo();
            DataSet ds = bll.GetList("fid="+pid);
            if (ds.Tables[0].Rows.Count == 1)
            {
                //this.lblcid.Text = ds.Tables[0].Rows[0]["cname"].ToString();
                this.lblpname.Text = ds.Tables[0].Rows[0]["fname"].ToString();
                this.lblppara.Text = "地址："+ds.Tables[0].Rows[0]["fadd"].ToString() +" 电话："+ ds.Tables[0].Rows[0]["ftel"].ToString() + "邮件："+ds.Tables[0].Rows[0]["femail"].ToString();
                this.lblpcontent.Text = ds.Tables[0].Rows[0]["fcontent"].ToString();               
                imgpic.ImageUrl = ds.Tables[0].Rows[0]["fpic"].ToString();
                this.Title = this.lblpname.Text;
            }

        }
    }
}